package com.anjbo.bean.estatedeal;

import com.anjbo.common.DateUtil;

import java.util.List;

/**
 * Created by Administrator on 2017/3/14.
 */
public class XMDealWrapperDto {

    /*一手房总套数*/
    private Integer oneTotal=0;
    /*一手房成交数据*/
    private List<XMDealDto> oneData;

    public List<XMDealDto> getOneData() {
        return oneData;
    }

    public void setOneData(List<XMDealDto> oneData) {
        if(oneData!=null){
            for(XMDealDto dto:oneData){
                oneTotal+=dto.getTotalNum();
            }
            toDateStr(oneData);
        }
        this.oneData = oneData;
    }

    private void toDateStr(List<XMDealDto> list){
        if(list!=null){
            for(XMDealDto dto:list){
                dto.setStartDateStr(DateUtil.getDateByFmt(dto.getStartDate(),"yyyy-MM-dd"));
                dto.setEndDateStr(DateUtil.getDateByFmt(dto.getEndDate(),"yyyy-MM-dd"));
            }
        }
    }
    public XMDealWrapperDto() {
    }

    public XMDealWrapperDto(List<XMDealDto> oneData) {
        this.oneData = oneData;
    }

    public Integer getOneTotal() {
        return oneTotal;
    }

    public void setOneTotal(Integer oneTotal) {
        this.oneTotal = oneTotal;
    }
}
